from django.contrib.auth.decorators import permission_required

from assets.util import HttpResponseSerialized, Fields

from configuration import default_path, blender_path, b2cs_path

@permission_required('assets.can_change_setting')
def configuration(request):
  info = {}
  info['ASSETS_EXPORT_DIR'] = {'path': default_path(), 'exists': os.path.exists(default_path())}
  info['BLENDER'] = {'path': blender_path(), 'exists': os.path.exists(blender_path())}
  info['B2_5CS'] = {'path': b2cs_path(), 'exists': os.path.exists(b2cs_path())}

  return HttpResponseSerialized(request, info)
